<!DOCTYPE html>
<html lang="zh">
<!-- 
https://github.com/studease/playease
 -->
<head>

</head>

<body>

	<div id='playwrap'
		style='margin: 0 auto; width: 100%; max-width: 640px; top: 0; left: 0;'>
		<div id='player'></div>
	</div>

	<script type="text/javascript">
		var pw = document.getElementById('playwrap');
		var events = playease.events;

		var player = playease('player');
		player.addEventListener(events.PLAYEASE_FULLPAGE, onFullpage);
		player.addEventListener(events.RESIZE, onResize);
		player.setup({
			width : 640,
			height : 400,
			aspectratio : '16:9',
			file : '/vod/sample.flv',
			/*sources: [{
				file: 'http://127.0.0.1/live/sample.flv',
				type: 'flv',
				label: 'HTTP-FLV'
			}, {
				file: 'ws://127.0.0.1/live/sample.flv',
				type: 'flv',
				label: 'WS-FLV'
			}, {
				file: 'ws://127.0.0.1/live/sample',
				type: 'rtmpmate',
				label: 'WS-RTMPMATE'
			}, {
				file: 'ws://127.0.0.1/live/sample',
				type: 'wss',
				label: 'WS-fMP4'
			}, {
				file: 'http://127.0.0.1/live/sample/manifest.mpd',
				type: 'dash',
				label: 'MPEG-DASH'
			}, {
				file: 'rtmp://127.0.0.1/live/sample',
				type: 'flash',
				label: 'RTMP-STREAM'
			}, {
				file: 'http://127.0.0.1/live/sample/index.m3u8',
				type: 'def'
			}],*/
			mode : 'vod',
			controls : true,
			autoplay : false,
			//poster: 'sample.png',
			//report: true,
			loader : {
				name : 'xhr-chunked-loader',
				chunkSize : 2 * 1024 * 1024,
				mode : 'cors'
			},
			logo : {
				file : 'logo.png'
			},
			bulletscreen : {
				enable : true,
				visible : true
			},
			/*fullpage: {
				visible: true
			},*/
			render : {
				name : 'flv',
				bufferLength : 4 * 1024 * 1024,
				swf : '../swf/playease.swf'
			}
		});

		function onFullpage(e) {
			pw.style.margin = e.exit ? '0 auto' : '0';
			pw.style.height = e.exit ? '' : '100%';
			pw.style.position = e.exit ? '' : 'fixed';
			pw.style.maxWidth = e.exit ? '640px' : '100%';
			pw.style.zIndex = e.exit ? '' : '99';
		}

		function onResize(e) {
			// x5-playsinline
			if (playease.utils.isAndroid() && playease.utils.isQQBrowser()) {
				var video = document.getElementById('player').firstChild.lastChild;
				video.style.width = window.innerWidth + 'px';
				video.style.height = window.innerHeight + 'px';
				video.style['object-position'] = 'center top';

				var controlbar = document.getElementById('player').childNodes[1];
				controlbar.style.top = e.height - 40 + 'px';
				controlbar.style.position = 'absolute';

				var next = document.getElementById('others');
				next.style.top = e.height + 'px';
				next.style.bottom = '0px';
				next.style.position = 'absolute';
				next.style.zIndex = 999;
			}

			// Something else
		}
	</script>

</body>

</html>
